import 'package:flutter/material.dart';

class DemoDrawer extends StatelessWidget {
  const DemoDrawer({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: ListView(
        padding: EdgeInsets.zero,
        children: [
          UserAccountsDrawerHeader(
            accountName: Text('wanghao',
                style: TextStyle(
                    fontWeight: FontWeight.bold,
                    color: Colors.white.withOpacity(0.8))),
            accountEmail: Text(
              'wanghao@qq.com',
              style: TextStyle(color: Colors.white.withOpacity(0.6)),
            ),
            currentAccountPicture: const CircleAvatar(
              backgroundImage: NetworkImage(
                  'https://img1.baidu.com/it/u=2175762828,1239136621&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1695488400&t=084ae8ef0c3ca9cf5b0ed62179f91f4f'),
            ),
            decoration: BoxDecoration(
                color: Colors.yellow[400],
                image: DecorationImage(
                    image: const NetworkImage(
                        'https://img2.baidu.com/it/u=1025213378,2197679907&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=793'),
                    fit: BoxFit.cover,
                    colorFilter: ColorFilter.mode(
                        Colors.black12.withOpacity(0.2), BlendMode.hardLight))),
          ),
          ListTile(
            title: const Text(
              "formDemo",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.message,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: (){
              debugPrint("onTap");
              Navigator.of(context).pushNamed("/form");
              // Navigator.pop(context);
            },
          ),
          ListTile(
            title: const Text(
              "MaterialCompinents",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.favorite,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: (){
              debugPrint("onTap");
              Navigator.of(context).pushNamed("/mdc");
            },
          ),
          ListTile(
            title: const Text(
              "Test",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/test"),
          ),
          ListTile(
            title: const Text(
              "i18n",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/i18n"),
          ),
          ListTile(
            title: const Text(
              "animation",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/animation"),
          ),
          ListTile(
            title: const Text(
              "http",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/http"),
          ),
          ListTile(
            title: const Text(
              "bloc",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/bloc"),
          ),
          ListTile(
            title: const Text(
              "rxdart",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/rxdart"),
          ),
          ListTile(
            title: const Text(
              "state",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/state"),
          ),
          ListTile(
            title: const Text(
              "stream",
              textAlign: TextAlign.right,
            ),
            trailing: const Icon(
              Icons.settings,
              color: Colors.black12,
              size: 22.0,
            ),
            onTap: () => Navigator.of(context).pushNamed("/stream"),
          )
          
        ],
      ),
    );
  }
}
